bunyan = require('bunyan')
config = require './config'

allStream = {
    type: 'rotating-file',
    path: config.log.all,
    period: '1d',
    count: 10 # keep 10 copies
}

system = bunyan.createLogger {
    name: "system",
    level: "trace",
    streams: [{
        type: 'rotating-file',
        path: config.log.system,
        period: '1d',
        count: 30 # keep 30 copies
    }, allStream]
}

user = bunyan.createLogger {
    name: "user",
    level: "trace",
    streams: [{
        type: 'rotating-file',
        path: config.log.user,
        period: '1d',
        count: 30 # keep 30 copies
    }, allStream]
}

exports.system = system
exports.user = user
